using System;
using Avalonia.Controls;
using Avalonia.Exusiai.Editor.Models;
using Avalonia.Markup.Xaml;

namespace Avalonia.Exusiai.Editor.Views;

public partial class MainWindowView : Window
{
    private readonly AppSettings _appSettings;
    public MainWindowView()
    {
        InitializeComponent();
    }
    private void InitializeComponent()
    {
        AvaloniaXamlLoader.Load(this);
        var dockPanel = this.FindControl<DockPanel>("Panel");
        var toolbar = this.FindControl<Border>("Toolbar");
        var project = this.FindControl<Border>("Project");
        var hierarchy = this.FindControl<Border>("Hierarchy");
        var sandBox = this.FindControl<Border>("SandBox");
        var inspection = this.FindControl<Border>("Inspection");

        var toolbarView = new ToolbarView();
        var projectView = new ProjectFileView();
        var hierarchyView = new SceneHierarchyView();
        var sandBoxView = new SandBoxView();
        var inspectionView = new ObjectInspectionView();
        var fileList = new FileListView();
        fileList = null;
        GC.Collect();

        if (toolbar != null) toolbar.Child = toolbarView;
        if (project != null) project.Child = projectView;
        if (hierarchy != null) hierarchy.Child = hierarchyView;
        if (sandBox != null) sandBox.Child = sandBoxView;
        if (inspection != null) inspection.Child = inspectionView;
    }
}